<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
<body>
    <ui:composition template="/WEB-INF/template.xhtml">
        <ui:define name="topnav">
            <ul>
                <li id="current"><h:commandLink action="main" value="Login"/></li>
            </ul>
        </ui:define>

        <ui:define name="sidebar">
            <ui:include src="/WEB-INF/incl/login.xhtml" />
        </ui:define>
       
        <ui:define name="body">
            <h:messages globalOnly="true" 
                        layout="list" 
                        errorClass="cntError"/>
            
            <h2><h:outputText value="#{msgs.newCustomerHeader}" /></h2>
            <h3><h:outputText value="#{msgs.newCustomerInfo}" /></h3>
            
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputText value="#{msgs.newCustomerFN}" />
                    <h:panelGroup>
                        <h:inputText id="firstName" required="true"
                                     value="#{customer.firstName}" />
                        <f:verbatim>*</f:verbatim>
                        <h:message for="firstName" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerLN}" />
                    <h:panelGroup>
                        <h:inputText id="lastName" required="true"
                                     value="#{customer.lastName}" />
                        <f:verbatim>*</f:verbatim>
                        <h:message for="lastName" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerA1}" />
                    <h:panelGroup>
                        <h:inputText id="address1" required="true"
                                     value="#{customer.address1}" />
                        <f:verbatim>*</f:verbatim>
                        <h:message for="address1" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerA2}" />
                    <h:panelGroup>
                        <h:inputText value="#{customer.address2}" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerCY}" />
                    <h:panelGroup>
                        <h:inputText id="city" required="true" 
                                     value="#{customer.city}" />
                        <f:verbatim>*</f:verbatim>
                        <h:message for="city" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerST}" />
                    <h:inputText value="#{customer.state}" />
                    
                    <h:outputText value="#{msgs.newCustomerZP}" />
                    <h:inputText value="#{customer.zip}" />
                    
                    <h:outputText value="#{msgs.newCustomerCO}" />
                    <h:selectOneMenu value="#{customer.country}">
                        <f:selectItem itemValue="United States" itemLabel="#{msgs.co_US}"/>
                        <f:selectItem itemValue="Australia" itemLabel="#{msgs.co_AU}" />
                        <f:selectItem itemValue="Canada" itemLabel="#{msgs.co_CA}" />
                        <f:selectItem itemValue="Chile" itemLabel="#{msgs.co_CL}" />
                        <f:selectItem itemValue="China" itemLabel="#{msgs.co_CH}" />
                        <f:selectItem itemValue="France" itemLabel="#{msgs.co_FR}" />
                        <f:selectItem itemValue="Germany" itemLabel="#{msgs.co_DE}" />
                        <f:selectItem itemValue="Japan" itemLabel="#{msgs.co_JP}" />
                        <f:selectItem itemValue="Russia" itemLabel="#{msgs.co_RU}" />
                        <f:selectItem itemValue="South Africa" itemLabel="#{msgs.co_ZA}" />
                        <f:selectItem itemValue="UK" itemLabel="#{msgs.co_UK}" />
                    </h:selectOneMenu> 
                    
                    <h:outputText value="#{msgs.newCustomerEM}" />
                    <h:inputText value="#{customer.email}" />
                    
                    <h:outputText value="#{msgs.newCustomerPH}" />
                    <h:inputText value="#{customer.phone}" />
                    
                    <h:outputText value="#{msgs.newCustomerUN}" />
                    <h:panelGroup>
                        <h:inputText id="userName" required="true" 
                                     value="#{customer.userName}">
                            <f:validateLength minimum="4" maximum="16"/> 
                        </h:inputText>
                        <f:verbatim>*</f:verbatim>
                        <h:message for="userName" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerPW}" />
                    <h:panelGroup>
                        <h:inputSecret id="password" required="true"
                                       value="#{customer.password}">
                            <f:validateLength minimum="8" /> 
                        </h:inputSecret>
                        <f:verbatim>*</f:verbatim>
                        <h:message for="password" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerP2}" />
                    <h:panelGroup>
                        <h:inputSecret id="passwordVerify" required="true"
                                       value="#{editCustomer.passwordVerify}">
                            <f:validateLength minimum="8" /> 
                        </h:inputSecret>
                        <f:verbatim>*</f:verbatim>
                        <h:message for="passwordVerify" styleClass="cntError" />
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerCCT}" />
                    <h:selectOneMenu value="#{customer.creditCardType}">
                        <f:selectItems value="#{editCustomer.creditCardTypes}" />
                    </h:selectOneMenu> 
                    
                    
                    <h:outputText value="#{msgs.newCustomerCCN}" />
                    <h:panelGroup>
                        <h:inputText id="creditCard" required="true" 
                                     value="#{customer.creditCard}" />
                        <f:verbatim>*</f:verbatim>
                        <h:message for="creditCard" styleClass="cntError" />
                    </h:panelGroup>
                    

                    <h:outputText value="#{msgs.newCustomerCCE}" />
                    <h:panelGroup>
                        <h:selectOneMenu value="#{customer.creditCardMonth}">
                            <f:selectItem itemValue="1" itemLabel="#{msgs.mo_1}" />
                            <f:selectItem itemValue="2" itemLabel="#{msgs.mo_2}" />
                            <f:selectItem itemValue="3" itemLabel="#{msgs.mo_3}" />
                            <f:selectItem itemValue="4" itemLabel="#{msgs.mo_4}" />
                            <f:selectItem itemValue="5" itemLabel="#{msgs.mo_5}" />
                            <f:selectItem itemValue="6" itemLabel="#{msgs.mo_6}" />
                            <f:selectItem itemValue="7" itemLabel="#{msgs.mo_7}" />
                            <f:selectItem itemValue="8" itemLabel="#{msgs.mo_8}" />
                            <f:selectItem itemValue="9" itemLabel="#{msgs.mo_9}" />
                            <f:selectItem itemValue="10" itemLabel="#{msgs.mo_10}" />
                            <f:selectItem itemValue="11" itemLabel="#{msgs.mo_11}" />
                            <f:selectItem itemValue="12" itemLabel="#{msgs.mo_12}" />
                        </h:selectOneMenu> 
                        
                        <h:selectOneMenu value="#{customer.creditCardYear}">
                            <f:selectItem itemValue="2005" />
                            <f:selectItem itemValue="2006" />
                            <f:selectItem itemValue="2007" />
                            <f:selectItem itemValue="2008" />
                            <f:selectItem itemValue="2009" />
                            <f:selectItem itemValue="2010" />
                        </h:selectOneMenu>
                    </h:panelGroup>
                    
                    <h:outputText value="#{msgs.newCustomerAG}" />
                    <h:inputText value="#{customer.age}" />
                    
                    <h:outputText value="#{msgs.newCustomerIN}" />
                    <h:inputText value="#{customer.income}" />
                    
                    
                    <h:outputText value="#{msgs.newCustomerGE}" />
                    <h:selectOneMenu value="#{customer.gender}">
                        <f:selectItem itemValue="M" itemLabel="#{msgs.gender_m}" />
                        <f:selectItem itemValue="F" itemLabel="#{msgs.gender_f}" />
                    </h:selectOneMenu> 
                </h:panelGrid>
                
                <h:commandButton action="#{editCustomer.create}" value="#{msgs.newCustomerSubmit}" />
            </h:form>

        </ui:define>
    </ui:composition>
</body>
</html>
